php random 5 digit number

54

generate random number of 4 digit in php -

<?php
$FourDigitRandomNumber = mt_rand(1111,9999);
echo $FourDigitRandomNumber;
?>

php random number -

// $min and $max are optional
rand($min,$max);

php randon integer 4 digit -

$digits = 3;
echo rand(pow(10, $digits-1), pow(10, $digits)-1);

Comments

Submit
0 Comments